<include file='Common:header' />

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">

    <!-- #section:basics/sidebar -->

    <include file='Common:left' />
    <!-- /section:basics/sidebar -->

    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">

                <div class="row">
                    <div class="col-xs-12">
                        <div>
                            <form id="classify_sort" name="classify_sort" method="post" action="{:U('classify_sort')}" >
                            <table width="100%" class="table table-striped table-bordered table-hover" id="dynamic-table">
                                <thead>
                                <tr>
                                    <th width="10%">ID</th>
                                    <th width="80%" style="text-align: center;">分类名称</th>
                                    <th width="10%" style="border-right:#CCC solid 1px;">操作</th>
                                </tr>
                                </thead>

                                <tbody>
                                <foreach name="catgory" item="v">
                                <tr>
                                    <td height="28">{$v.id}</td>
                                    <td style="text-align: center;">{$v.name}</td>
                                    <td>
                                        <div class="hidden-sm hidden-xs action-buttons">
                                            <a class="green"  href="{:U('edit_country',array('id'=>$v['id']))}"  title="修改">
                                                <i class="ace-icon fa fa-pencil bigger-130"></i>
                                            </a>
                                            <a class="red" href="javascript:;" onclick="return del({$v.id});" title="删除">
                                                <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                </foreach>
                                <td height="50" colspan="10" align="left">{$page}</td>
                                </tbody>
                            </table>
                            </form>
                        </div>
                    </div>
                </div>
                <include file='Common:header_nav' />


            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file='Common:footer' />

    <script type="text/javascript">
        $(function(){
            $('#classify_sort').ajaxForm({
                success: complete, // 这是提交后的方法
                dataType: 'json'
            });

            function complete(data){
                if(data.status==1){
                    layer.alert(data.info, {icon: 6}, function(index){
                        layer.close(index);
                        window.location.href=data.url;
                    });
                }else{
                    layer.alert(data.info, {icon: 6}, function(index){
                        layer.close(index);
                        window.location.href=data.url;
                    });
                }
            }
        });
        function del(id){
            layer.confirm('你确定要删除吗？', {icon: 3}, function(index){
                layer.close(index);
                window.location.href="__URL__/country_del/id/"+id;//重新获取当前页面，删除后返回当前页码
            });
        }

    </script>
</div><!-- /.main-container -->
</body>
</html>
